package de.koller.aframe.sound.wave;

import javax.sound.midi.MidiSystem;
import javax.sound.midi.Receiver;
import javax.sound.midi.ShortMessage;
import javax.sound.midi.Synthesizer;

public class SimpleWave {

	public static void main( String[] args ) throws Exception {
		Synthesizer synth = MidiSystem.getSynthesizer();
		synth.open();
		Receiver rcvr = synth.getReceiver();
		ShortMessage msg = new ShortMessage();
		msg.setMessage(ShortMessage.NOTE_ON, 0, 40, 40);
		rcvr.send(msg, -1);
		Thread.sleep(1500);
		msg.setMessage(ShortMessage.NOTE_OFF, 0, 40, 0);
		rcvr.send(msg, -1);
		synth.close();
	}
	
}
